const router = require('koa-router')()

router.get('/', async (ctx, next) => {
  await ctx.render('index', {
    title: '巴挂后台！'
  })
})

router.get('/string', async (ctx, next) => {
  ctx.body = 'koa2 string'
})

router.get('/json', async (ctx, next) => {
  ctx.body = {
    title: 'koa2 json'
  }
})

router.get('/socket', async (ctx, next) => {
  await ctx.render('socket.html',{
    title: 'socket测试'
  })
})

router.get('/game', async (ctx, next) => {
  await ctx.render('game.html',{
    title: '恭喜匹配成功，正在开始游戏...'
  })
})

module.exports = router
